from fastapi import APIRouter
from fastapi import Response
import datetime
import numpy as np
import pandas as pd


router = APIRouter(
    prefix='/echarts_line',
    tags=['echarts_line']
)


@router.get('/fristsimple_line')
async def fristsimple_line():
    data = pd.DataFrame({'x_data': ['Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun'],
                         'y_data': [150, 230, 224, 218, 135, 147, 260]})
    return Response(data.to_json(orient='records'), media_type='application/json')


@ router.get("/")
async def root():
    return {"message": "this message is from simple_line", "datetime": datetime.datetime.now(), "test": 'this is a test'}


# uvicorn main:app --reload
